package com.zzqsecurity.controller;


import com.zzqsecurity.entity.TUser;
import com.zzqsecurity.service.TUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zzq
 * @since 2021-08-24
 * https://blog.csdn.net/gongm24/article/details/103970667
 * <p>
 * https://gitee.com/gongm_24/spring-boot-tutorial/tree/master/chapter26
 * <p>
 * https://www.jb51.net/article/141972.htm
 */
@RestController
@RequestMapping("/user")
public class TUserController {

    @Autowired
    TUserService tUserService;

    @PreAuthorize("hasAuthority('adminss')")
    @GetMapping("/get")
    public List<TUser> getUserList() {
        return tUserService.getUserList();
    }

}
